package com.runchen.broadcastdetection.ui.activity.login;

import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;

import androidx.annotation.NonNull;

import com.runchen.broadcastdetection.ui.activity.home.MainActivity;
import com.runchen.broadcastdetection.databinding.ActivityWelcomeBinding;
import com.ruochen.common.base.BaseActivity;
import com.ruochen.common.utils.SerializableSpTools;

public class WelcomeActivity extends BaseActivity<ActivityWelcomeBinding> {
    @Override
    protected void initView(Bundle var1) {
        handler.sendEmptyMessageDelayed(0, 2000);
    }

    private Handler handler = new Handler(Looper.getMainLooper()){
        @Override
        public void handleMessage(@NonNull Message msg) {
            super.handleMessage(msg);
            if(SerializableSpTools.isLogin()){
                startActivity(MainActivity.class);
            }else{
                startActivity(LoginActivity.class);
            }
            WelcomeActivity.this.onBackPressed();
        }
    };
}
